//
//  SettingViewController.m
//  YiqiMobile
//
//  Created by henry on 13-4-14.
//  Copyright (c) 2013年 henry. All rights reserved.
//

#import "SettingViewController.h"
#import "Utility.h"
#import "Config.h"
#import "AppDelegate.h"
@interface SettingViewController ()

@end

@implementation SettingViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad{
    [super viewDidLoad];
     self.navigationItem.titleView=[Utility getTitleView:@"设置"];
    [self.view addSubview:[Utility customButton:self action:@selector(logout:) normalImage:nil lightedImage:nil frame:CGRectMake(100, 100, 60, 40) title:@"退出" tag:20]];
	// Do any additional setup after loading the view.
}

-(IBAction)logout:(id)sender{
    NSUserDefaults *user=[NSUserDefaults standardUserDefaults];
    [user setObject:nil forKey:USERID];
    [user setObject:nil forKey:USERNAME];
    [user setObject:nil forKey:USERNICKNAME];
    [user setObject:nil forKey:USERPASSWORD];
    [user setObject:nil forKey:USERLOGO];
    [user setObject:nil forKey:USERINTRO];
    [user synchronize];
    AppDelegate *app=(AppDelegate*)[[UIApplication sharedApplication] delegate];
    [app popLoginViewController];
}

- (void)didReceiveMemoryWarning{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
